//Plugins.load( "../../jiggyface/jigglins/jiggy.UIKit.js" );
//include("../../libraries/jiggy.magic.js");
//include("../../libraries/jiggy.objects.js");
include("PageController.js");

PageController.init();

var mainPage = new Page("main", "My Test App", Color.green);
var settingsPage = new Page("settings", "Settings", Color.blue, null, mainPage);
mainPage.nextPage = settingsPage;
settingsPage.nextPage = mainPage;
PageController.addPage(mainPage);
PageController.addPage(settingsPage);

PageController.showPage(mainPage);

var settingsButton = new UIPushButton(Rectangle(0, 100, PageController.viewRect.getWidth(), 100));
settingsButton.backgroundColor = Color(0,0,0,0.5);
settingsButton.title = "Settings...";
settingsButton.autosizesToFit = false;
settingsButton.onPressed = function () {
	PageController.showPage(settingsPage, true);
};
mainPage.addSubview(settingsButton);

var settingsText = new UITextLabel(Rectangle(0, 100, PageController.viewRect.getWidth(), 100));
settingsText.backgroundColor = Color(1,1,1,1);
settingsText.text = "Settings Page";
settingsPage.addSubview(settingsText);